import React, { Component } from 'react'
import {connect} from "react-redux"

class Register extends Component {
  componentDidMount(){
    console.log(this.props);
  }
  render() {
    return (
      <div>
        <h3>Register</h3>
        {/* <p>{this.props.state.CountRD.count}</p> */}
      </div>
    )
  }
}

//自己定义一个函数
const mapStateToProps = (state)=>{
      return {
        count1:state.CountRD.count
      }
}

export default connect(mapStateToProps)(Register)


// function connect(fn){
//     //获取到仓库数据
//     const state = store.getState()
//     //fn(state)
//     return function(component){
//         const newCompont = component.props.dispatch state
//         return newCompont
//     }
// }